/*
	This file is part of Erosion, a clone of Qix
	Copyright (c) 2009 Bill Whitacre

	Permission is hereby granted, free of charge, to any person obtaining a copy
	of this software and associated documentation files (the "Software"), to deal
	in the Software without restriction, including without limitation the rights
	to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
	copies of the Software, and to permit persons to whom the Software is
	furnished to do so, subject to the following conditions:

	The above copyright notice and this permission notice shall be included in
	all copies or substantial portions of the Software.

	THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
	IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
	FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
	AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
	LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
	OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
	THE SOFTWARE.
*/

#ifndef DRAW_H
#define DRAW_H

#if defined(_MSC_VER)||defined(__WIN32__)
#	include <windows.h>
#endif

#include <stdlib.h>
#include <math.h>

#if defined(__APPLE__)
#	include <OpenGL/gl.h>
#else
#	include <GL/gl.h>
#endif

#ifndef MATH_PI
#	ifndef M_PI
#		define MATH_PI 3.14159f
#	else
#		define MATH_PI M_PI
#	endif
#endif

#include "rat_physics.h"

#ifdef __cplusplus
extern "C" {
#endif

extern int rat_pretty_draw;

void rat_line_width(float width);
void rat_point_size(float size);
void rat_set_color(float r,float g,float b,float a);
void rat_get_color(float *r,float *g,float *b,float *a);

void rat_draw_point(float x,float y);
void rat_draw_points(float *points,unsigned int numpts);
void rat_draw_line(float x1,float y1,float x2,float y2);
void rat_draw_lines(float *points,unsigned int numpts);
void rat_draw_line_strip(float *points,unsigned int numpts);
void rat_draw_line_loop(float *points,unsigned int numpts);
void rat_draw_quads(float *points,unsigned int numpts);
void rat_draw_triangles(float *points,unsigned int numpts);
void rat_draw_triangle_fan(float *points,unsigned int numpts);
void rat_draw_triangle_strip(float *points,unsigned int numpts);

void rat_draw_rect(float x1,float y1,float x2,float y2,int fill);
void rat_draw_circle(float x,float y,float radius,float stepdivisor,int fill);
void rat_draw_elipse(float x,float y,float rx,float ry,float stepdivisor,int fill);

void rat_draw_body(rat_body *body,int pass);
void rat_draw_constraint(rat_constraint *constraint);
void rat_draw_spring(rat_spring *spring);

#ifdef __cplusplus
}
#endif

#endif
